
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include "comm.h"
#include "heap_user.h"

struct head {
	int res1;
	int res2;
	unsigned char *pbuf;
};

void container_deep_test(unsigned char *pbuf)
{
	
}

void container_test(void)
{
	struct head pkg;

	pkg.pbuf = malloc(16);

	tc_log("pbuf %p offsetof(struct head, pbuf) %d", pkg.pbuf, offsetof(struct head, pbuf));
	struct head *ptr = container_of(&pkg.pbuf, struct head, pbuf);
	tc_log("&pkg %p ptr %p pbuf %p", &pkg, ptr, pkg.pbuf);

	container_deep_test(pkg.pbuf);

	free(pkg.pbuf);
}

int main(int argc, char const *argv[])
{
	tc_log("********************");
	tc_log("this is a new start.");
	tc_log("********************");

	container_test();
    // heap_test();

	tc_log("exit");
	return 0;
}

